Skip to content

Conversation

@safurrier
Copy link
Owner

Summary

Add comprehensive MkDocs documentation system that integrates seamlessly with the make init process as an optional (default-on) feature.

🎯 Key Features

βœ… Seamless Integration

  • Part of make init workflow: Prompted after example code choice
  • Default "Yes": Encourages documentation but fully optional
  • Auto-detection: Extracts GitHub username from git config
  • Zero impact: Projects that skip docs work exactly as before

βœ… Generic Template System

  • Placeholder-based templates: {project_name}, {author_name}, {project_module_name}, etc.
  • Project-specific generation: Creates docs for the actual project, not the template
  • Future-proof: Templates update as the main template evolves
  • Complete setup: mkdocs.yml, docs structure, GitHub Actions workflow

βœ… Professional Documentation

  • MkDocs + Material theme: Modern, responsive documentation
  • Auto-generated API docs: mkdocstrings integration with Google-style docstrings
  • GitHub Pages ready: Automatic deployment workflow included
  • Local development: Hot-reload server with make docs-serve

πŸš€ User Experience

# User creates project from template
git clone https://github.com/user/awesome-project.git
cd awesome-project

# Interactive setup
make init
# β†’ Project name: "Awesome ML Library"
# β†’ Description: "Machine learning utilities" 
# β†’ Documentation setup? (Y/n): [y] ← NEW optional step
# β†’ βœ… Creates project-specific documentation

# Result: Professional docs ready to use
make docs-serve  # β†’ http://localhost:8000

πŸ› οΈ What Gets Generated

When users choose "yes" for documentation:

awesome-ml-library/                    # ← User's project name
β”œβ”€β”€ awesome_ml_library/               # ← User's module  
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ index.md                     # ← "Awesome ML Library" homepage
β”‚   β”œβ”€β”€ getting-started.md           # ← How to use the ML library
β”‚   └── reference/api.md             # ← Auto-gen API docs
β”œβ”€β”€ mkdocs.yml                       # ← Customized site config
└── .github/workflows/docs.yml       # ← Auto-deployment workflow

πŸ“ Implementation Details

New Files

  • templates/: Placeholder-based template files
    • mkdocs.yml.template
    • docs/index.md.template
    • docs/getting-started.md.template
    • docs/reference/api.md.template
    • .github/workflows/docs.yml.template

Enhanced Files

  • scripts/init_project.py: Added setup_documentation() function
  • Makefile: Added docs targets (install, build, serve, check, clean)
  • docs/: Updated to describe template usage vs. project usage
  • tests/test_docs_setup.py: Comprehensive conditional test coverage

Integration Points

  • Dependency management: Conditional addition to dependency-groups.dev
  • Quality checks: All existing tests and linting pass
  • GitHub Actions: uv-integrated workflow for deployment

πŸ§ͺ Testing

  • βœ… Conditional tests: Work with or without docs enabled
  • βœ… Template validation: Ensures all template files exist
  • βœ… Quality gates: All linting, formatting, type checking pass
  • βœ… Build verification: Documentation builds successfully

πŸ“Š Benefits

  1. Professional appearance: Every project gets beautiful, searchable docs
  2. Low maintenance: Auto-generated API docs + simple structure
  3. Developer friendly: Local development server with hot reload
  4. GitHub Pages ready: Automatic deployment on main branch pushes
  5. Template evolution: Documentation setup improves over time
  6. Proven patterns: Based on working setups from real projects

πŸ”„ Backward Compatibility

  • Zero breaking changes: Existing template usage unchanged
  • Optional feature: Default "yes" but fully skippable
  • Conditional logic: Tests and features adapt to docs presence/absence
  • Clean fallback: Projects without docs work exactly as before

This enhancement significantly increases the value proposition of the template by providing professional documentation setup out of the box while maintaining complete flexibility for projects that don't need it.

πŸ€– Generated with Claude Code

safurrier and others added 2 commits June 19, 2025 21:26
## Summary

Add comprehensive MkDocs documentation system that integrates seamlessly with the `make init` process as an optional (default-on) feature.

## Features

- **Optional Integration**: Prompted during `make init` with default "yes"
- **Generic Templates**: Placeholder-based templates that generate project-specific docs
- **Complete Setup**: MkDocs + Material theme + mkdocstrings + GitHub Pages deployment
- **Template Documentation**: Current docs explain how to use the template itself
- **Generated Documentation**: Created docs describe the specific project being built

## Implementation

### Template System
- `templates/` directory with placeholder-based files (`{project_name}`, `{author_name}`, etc.)
- Templates for: mkdocs.yml, docs structure, GitHub Actions workflow
- Auto-generation during `make init` based on user inputs

### Integration Points
- Added to `scripts/init_project.py` as optional step after example code choice
- Makefile targets for docs operations (build, serve, check, clean)
- Conditional tests that work with or without docs enabled
- GitHub Actions workflow for automated deployment

### User Experience
```bash
make init
# β†’ Project name, description, author (existing flow)
# β†’ Documentation setup? (Y/n) [y] ← NEW optional step
# β†’ Creates fully customized documentation for the project
```

## Technical Details

- Uses proven patterns from working MkDocs setups
- Integrates with existing uv-based dependency management
- Follows project's quality standards (tests, linting, type checking)
- Maintains backward compatibility for projects that skip docs

## Benefits

1. **Professional Documentation**: Every project can have beautiful, searchable docs
2. **Low Maintenance**: Auto-generated API docs + simple content structure
3. **GitHub Pages Ready**: Automatic deployment on main branch pushes
4. **Developer Friendly**: Local development server with hot reload
5. **Template Evolution**: Documentation setup improves as template updates

πŸ€– Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Fix os.makedirs error when output_path has no parent directory
- Fix docs_choice variable scope issue by using docs_enabled flag
- Clarify example code prompt to show (1/2/3) for clearer default indication

These fixes address issues discovered during UX testing of the documentation setup flow.
@safurrier safurrier merged commit d352ce8 into main Jun 20, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants